<?php

declare(strict_types=1);

use Fisharebest\Webtrees\Family;
use Fisharebest\Webtrees\I18N;
use Fisharebest\Webtrees\Individual;

/* @var array      $records */
/* @var Family     $family */
/* @var Individual $child1 */
/* @var Individual $child2 */
?>

<?php if ($records) : ?>
    <ul class="list-group list-group-flush">
        <?php foreach ($records as $record) : ?>
            <?php $child1 = $record['child1']; ?>
            <?php $child2 = $record['child2']; ?>
            <?php $family = $record['family']; ?>
            <li class="list-group-item d-flex justify-content-between align-items-center">
                <span>
                    <a href="<?= e($child2->url()) ?>"><?= $child2->fullName() ?></a> <?= I18N::translate('and') ?> <a href="<?= e($child1->url()) ?>"><?= $child1->fullName() ?></a>
                    <br>
                    <a href="<?= e($family->url()) ?>">[<?= I18N::translate('View this family') ?>]</a>
                </span>
                <span class="badge badge-secondary badge-pill ml-3"><?= $record['age'] ?></span>
            </li>
        <?php endforeach; ?>
    </ul>
<?php else : ?>
    <div class="card-body">
        <?= I18N::translate('This information is not available.') ?>
    </div>
<?php endif; ?>
